Skip to content

Conversation

@kokila-19
Copy link
Contributor

What changes were proposed in this pull request?

Implemented Natural ordering(write ordered by) ALTER TABLE DDL support for Iceberg tables.

Why are the changes needed?

Existing tables can be converted to natural ordered tables using ALTER command. Note that only the data inserted after alter query are ordered, not existing data.

Does this PR introduce any user-facing change?

yes, supported new syntax

SYNTAX:
ALTER TABLE table_name SET WRITE ORDERED BY column_name sort_direction NULLS FIRST/LAST, ...

EXAMPLE:
ALTER TABLE table_order SET WRITE ORDERED BY id desc nulls first, name asc nulls last;

How was this patch tested?

qtest

@kokila-19
Copy link
Contributor Author

I have addressed all the comments and refactored the code as well.
Please review them.
@deniskuzZ

@kokila-19 kokila-19 requested a review from deniskuzZ January 12, 2026 13:16
Copy link
Member

@deniskuzZ deniskuzZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some minor things

Copy link
Member

@deniskuzZ deniskuzZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

SYNTAX:
ALTER TABLE table_name SET WRITE ORDERED BY column_name sort_direction NULLS FIRST/LAST, ...

EXAMPLE:
ALTER TABLE table_order SET WRITE ORDERED BY id desc nulls first, name asc nulls last;
@sonarqubecloud
Copy link

@deniskuzZ deniskuzZ merged commit 75645c5 into apache:master Jan 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants